
import java.awt.GridLayout;
import java.awt.LayoutManager;
import java.awt.event.KeyListener;
import java.awt.event.MouseListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;


/**
 * Ceci est la doc de la class test
 * @author valleo
 * 
 * @version 1.0
 *
 */

public class test {

	/**
	 * 
	 * La fonction main est cool.
	 * @author valleo
	 * @version 1.0
	 * 
	 * @param args
	 * 		Les arguments de la méthode main
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		System.out.println("test réussi...");
		JPanel panel = new JPanel();
		
		panel.setLocation(0, 0);
		JFrame compo = new JFrame("Frame test");
		compo.add(panel);
		compo.setBounds(0, 0, 100, 100);
		compo.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		panel.add(new JLabel("Frame test"));
		
		Essai test = new Essai();
		panel.add(new JLabel("\nB : "+test.b));
		panel.add(new JLabel("\n1 + 3 = "+test.add(1, 3)));
		JTextField textField = new JTextField();
		panel.add(textField);
		
		JButton bouton = new JButton("valider");
		MouseListener mouseListener = new MouseListenerImpl();
		((MouseListenerImpl) mouseListener).setTextField(textField);
		bouton.addMouseListener(mouseListener);
		panel.add(bouton);
		
		LayoutManager layout = new GridLayout();
		layout.addLayoutComponent("lol", textField);
		panel.setLayout(layout);
		
		KeyListener listener = new KeyListenerImpl();
		
		
		textField.addKeyListener(listener);
		
		compo.pack();
		compo.setVisible(true);
		
		
	}

}
